//k1 edit 21.12.18

private ["_center","_rotation","_obj","_staticWeaponClasses","_parkedVehicleClasses"];
_center = param[0];
_rotation = param[1];

_staticWeaponClasses = if(count _this > 2)then [{_this select 2},{[]}];
_parkedVehicleClasses = if(count _this > 3)then[{_this select 3},{[]}];

[_center,40] call a3e_fnc_cleanupTerrain;

_fnc_createObject = {
    params["_className","_centerPos","_relativePos","_rotateDir","_relativeDir"];
    private["_object", "_realPos", "_realDir"];

    _fnc_rotatePos = {
        private ["_centerPos", "_pos", "_dir"];
        private ["_px", "_py", "_mpx", "_mpy", "_ma", "_rpx", "_rpy"];
        _centerPos = _this select 0;
        _pos = _this select 1;
        _dir = _this select 2;
        _px = _pos select 0;
        _py = _pos select 1;
        _mpx = _centerPos select 0;
        _mpy = _centerPos select 1;
        _ma = _dir;
        _rpx = ( (_px - _mpx) * cos(_ma) ) + ( (_py - _mpy) * sin(_ma) ) + _mpx;
        _rpy = (-(_px - _mpx) * sin(_ma) ) + ( (_py - _mpy) * cos(_ma) ) + _mpy;
        [_rpx, _rpy, (_pos select 2)];
    };

    _realPos = ([_centerPos, [(_centerPos select 0) + (_relativePos select 0), (_centerPos select 1) + (_relativePos select 1),(_relativePos select 2)], _rotateDir] call _fnc_rotatePos);
    _object = createVehicle [_className, _realPos, [], 0, "CAN_COLLIDE"];
    _object setdir (_relativeDir + _rotateDir);
    _object setPosATL _realPos;
    _object
};

_obj = objNull;
_obj = ["Land_Cargo_Tower_V1_F",_center,[-12.0586,-9.98413,0],_rotation,90] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[-16.689,-21.322,0],_rotation,0] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[-22.314,-9.82202,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[-22.439,-1.57202,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_Bunker_01_HQ_F",_center,[-12.3652,7.01294,0.236],_rotation,180] call _fnc_createObject;
_obj = ["Land_HBarrierTower_F",_center,[-16.939,19.428,0],_rotation,135] call _fnc_createObject;
_obj = ["Land_BarGate_F",_center,[-0.25,-29.25,0.249998],_rotation,180] call _fnc_createObject;
_obj = ["Land_BagBunker_Tower_F",_center,[-7.56396,-21.822,0],_rotation,0] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[-8.68896,-17.697,0],_rotation,180] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[-17.064,-17.822,0],_rotation,180] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[-18.939,-14.822,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[-18.939,-6.57202,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[-9.31396,25.803,0],_rotation,180] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[-22.564,22.803,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[-22.564,14.678,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[-22.439,6.55298,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[-17.439,25.803,0],_rotation,180] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[-19.064,10.053,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[-19.189,18.428,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[-9.06396,22.053,0],_rotation,0] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[-19.064,1.80298,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[-17.314,21.803,0],_rotation,0] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[-8.69,-17.7,0],_rotation,180] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[-17.06,-17.8,0],_rotation,180] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[-18.94,-14.8,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[-18.94,-6.57,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[17.81,-13.947,0],_rotation,90] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[17.686,-5.572,0],_rotation,90] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[15.94,-17.2,0],_rotation,180] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[7.686,-17.45,0],_rotation,180] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[15.686,22.428,0],_rotation,0] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[17.561,11.053,0],_rotation,90] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[-0.814,22.18,0],_rotation,0] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[17.561,19.3,0],_rotation,90] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[17.686,2.678,0],_rotation,90] call _fnc_createObject;
_obj = ["Land_HBarrierWall6_F",_center,[7.43604,22.3,0],_rotation,0] call _fnc_createObject;
_obj = ["Land_BagBunker_Small_F",_center,[-18.064,20.18,4.211],_rotation,135] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[15.811,-20.697,0],_rotation,0] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[21.061,-9.197,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[20.936,-2.197,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[21.061,-17.322,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[20.936,5.928,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[-1.18896,25.928,0],_rotation,180] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[20.936,22.553,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[15.186,25.928,0],_rotation,180] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[6.93604,25.928,0],_rotation,180] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[20.936,14.428,0],_rotation,270] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[17.811,-13.947,0],_rotation,90] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[17.686,-5.57202,0],_rotation,90] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[15.936,-17.197,0],_rotation,180] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[7.686,-17.447,0],_rotation,180] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[15.686,22.428,0],_rotation,0] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[17.561,11.053,0],_rotation,90] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[-0.814,22.178,0],_rotation,0] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[17.561,19.303,0],_rotation,90] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[17.686,2.67798,0],_rotation,90] call _fnc_createObject;
_obj = ["Land_Razorwire_F",_center,[7.436,22.303,0],_rotation,0] call _fnc_createObject;
_obj = ["Land_Communication_F",_center,[16.186,-15.697,0],_rotation,0] call _fnc_createObject;
_obj = ["Land_Cargo_HQ_V1_F",_center,[10.4375,-7.7146,0],_rotation,90] call _fnc_createObject;
_obj = ["Land_BagBunker_Tower_F",_center,[6.43604,-21.572,0],_rotation,0] call _fnc_createObject;
_obj = ["Land_Cargo_House_V1_F",_center,[12.6748,10.0381,0],_rotation,90] call _fnc_createObject;
_obj = ["Land_Cargo_House_V1_F",_center,[12.75,1.75,0],_rotation,90] call _fnc_createObject;
_obj = ["Land_HBarrierTower_F",_center,[14.936,20.053,0],_rotation,225] call _fnc_createObject;
_obj = ["Land_BagBunker_Small_F",_center,[15.436,20.428,4.21],_rotation,225] call _fnc_createObject;

_obj = ["Land_DataTerminal_01_F",_center,[-12.5,-7,17.89],_rotation,90] call _fnc_createObject;
_obj allowDamage false;
_obj setVariable ["A3E_isTerminal",true,true];
[_obj,"green","green","green"] call BIS_fnc_DataTerminalColor;

_obj = ["Box_East_WpsSpecial_F",_center,[-11.75,6.75,0.4],_rotation,90] call _fnc_createObject;
_obj allowDamage false;
_obj = ["Box_East_WpsSpecial_F",_center,[15.824,9.63,1],_rotation,180] call _fnc_createObject;
_obj allowDamage false;
_obj = ["Box_East_WpsSpecial_F",_center,[16,1.75,1],_rotation,180] call _fnc_createObject;
_obj allowDamage false;
_obj = ["Box_East_Ammo_F",_center,[16,-12.5,1],_rotation,180] call _fnc_createObject;
_obj allowDamage false;
_obj = ["Box_East_WpsLaunch_F",_center,[15.964,-11,1],_rotation,180] call _fnc_createObject;
_obj allowDamage false;
_obj = ["Box_East_Wps_F",_center,[15.75,-14,1],_rotation,180] call _fnc_createObject;
_obj allowDamage false;
_obj = ["Box_CSAT_Equip_F",_center,[-12.89,6.935,0.4],_rotation,0] call _fnc_createObject;
_obj allowDamage false;

//Statics
_MGGMH = a3e_arr_Escape_SWC_MG_H + a3e_arr_Escape_SWC_GM_H;
_gun = selectRandom _MGGMH;
_obj = [_gun,_center,[-6.62793,-5.37744,17.86],_rotation,45] call _fnc_createObject;
Escape_allStatics pushback _obj;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom _MGGMH;
_obj = [_gun,_center,[-7.81396,-23.572,-0.012],_rotation,180] call _fnc_createObject;
Escape_allStatics pushback _obj;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom _MGGMH;
_obj = [_gun,_center,[-7.9248,-14.82,17.876],_rotation,135] call _fnc_createObject;
Escape_allStatics pushback _obj;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom _MGGMH;
_obj = [_gun,_center,[-17.2549,-5.8567,17.779],_rotation,270] call _fnc_createObject;
Escape_allStatics pushback _obj;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom _MGGMH;
_obj = [_gun,_center,[-12.9307,-16.1006,17.875],_rotation,180] call _fnc_createObject;
Escape_allStatics pushback _obj;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom _MGGMH;
_obj = [_gun,_center,[-7.81396,-23.697,2.7672],_rotation,180] call _fnc_createObject;
Escape_allStatics pushback _obj;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom _MGGMH;
_obj = [_gun,_center,[-18.3052,20.7356,2.267],_rotation,315] call _fnc_createObject;
Escape_allStatics pushback _obj;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom _MGGMH;
_obj = [_gun,_center,[-18.0107,20.4763,4.202],_rotation,315] call _fnc_createObject;
Escape_allStatics pushback _obj;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom _MGGMH;
_obj = [_gun,_center,[6.50293,-23.135,-0.0121],_rotation,180] call _fnc_createObject;
Escape_allStatics pushback _obj;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom _MGGMH;
_obj = [_gun,_center,[6.31104,-23.572,2.76719],_rotation,180] call _fnc_createObject;
Escape_allStatics pushback _obj;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom _MGGMH;
_obj = [_gun,_center,[13.25,-5,3.114],_rotation,45] call _fnc_createObject;
Escape_allStatics pushback _obj;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom _MGGMH;
_obj = [_gun,_center,[15.5127,-13.51,3.1],_rotation,135] call _fnc_createObject;
Escape_allStatics pushback _obj;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom _MGGMH;
_obj = [_gun,_center,[5.43701,-6.5,3.113],_rotation,270] call _fnc_createObject;
Escape_allStatics pushback _obj;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom _MGGMH;
_obj = [_gun,_center,[16.2578,21.3806,2.267],_rotation,45] call _fnc_createObject;
Escape_allStatics pushback _obj;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom _MGGMH;
_obj = [_gun,_center,[15.7549,20.4878,4.208],_rotation,45] call _fnc_createObject;
Escape_allStatics pushback _obj;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];

_MGGMA = a3e_arr_Escape_SWC_MG_A + a3e_arr_Escape_SWC_GM_A;
_gun = selectRandom _MGGMA;
_obj = [_gun,_center,[-7.57568,-19.943,2.856],_rotation,270] call _fnc_createObject;
Escape_allStatics pushback _obj;
_gun = selectRandom _MGGMA;
_obj = [_gun,_center,[6.29199,-19.7559,2.856],_rotation,90] call _fnc_createObject;
Escape_allStatics pushback _obj;
_gun = selectRandom a3e_arr_Escape_SWC_MG_A;
_obj = [_gun,_center,[-3.77539,16.7939,0],_rotation,180] call _fnc_createObject;
Escape_allStatics pushback _obj;

_gun = selectRandom a3e_arr_Escape_SWC_launcher_AT;
_obj = [_gun,_center,[-7.59814,-23.4685,4.91],_rotation,225] call _fnc_createObject;
[_obj,A3E_VAR_Side_Opfor] spawn A3E_fnc_AddStaticGunner;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom a3e_arr_Escape_SWC_launcher_AT;
_obj = [_gun,_center,[6.18604,-23.197,4.91],_rotation,135] call _fnc_createObject;
[_obj,A3E_VAR_Side_Opfor] spawn A3E_fnc_AddStaticGunner;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom a3e_arr_Escape_SWC_launcher_AT;
_obj = [_gun,_center,[-18.2979,20.2,6.213],_rotation,315] call _fnc_createObject;
[_obj,A3E_VAR_Side_Opfor] spawn A3E_fnc_AddStaticGunner;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom a3e_arr_Escape_SWC_launcher_AT;
_obj = [_gun,_center,[15.481,20.7556,6.21],_rotation,45] call _fnc_createObject;
[_obj,A3E_VAR_Side_Opfor] spawn A3E_fnc_AddStaticGunner;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];

_gun = selectRandom a3e_arr_Escape_SWC_launcher_AA;
_obj = [_gun,_center,[-10,4.74976,3.58],_rotation,135] call _fnc_createObject;
[_obj,A3E_VAR_Side_Opfor] spawn A3E_fnc_AddStaticGunner;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom a3e_arr_Escape_SWC_launcher_AA;
_obj = [_gun,_center,[-10.1748,9.181,3.58],_rotation,45] call _fnc_createObject;
[_obj,A3E_VAR_Side_Opfor] spawn A3E_fnc_AddStaticGunner;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom a3e_arr_Escape_SWC_launcher_AA;
_obj = [_gun,_center,[-14.5,4.75,3.58],_rotation,225] call _fnc_createObject;
[_obj,A3E_VAR_Side_Opfor] spawn A3E_fnc_AddStaticGunner;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_gun = selectRandom a3e_arr_Escape_SWC_launcher_AA;
_obj = [_gun,_center,[-14.6748,9.18091,3.58],_rotation,315] call _fnc_createObject;
[_obj,A3E_VAR_Side_Opfor] spawn A3E_fnc_AddStaticGunner;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];

//veh
_parkedVehicleClasses append ["C_Heli_Light_01_civil_F","B_Heli_Light_01_F","I_Heli_light_03_unarmed_F"];
_vehicle = selectRandom _parkedVehicleClasses;
_obj = [_vehicle,_center,[7.5,15.7305,0],_rotation,180] call _fnc_createObject;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];
_vehicle = selectRandom _parkedVehicleClasses;
_obj = [_vehicle,_center,[0.75,15.4802,0],_rotation,180] call _fnc_createObject;
Escape_all_assets pushback _obj;
_obj setVariable ["Escape_assets_control", true, true];

Escape_campType_arr pushback [_center,"信号站","Jade"];
publicVariable "Escape_campType_arr";


